package com.xxx.base.rest;

import com.xxx.base.service.TestService;
import com.xxx.base.util.Log;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("test")
public class TestController {
    protected final Log log = Log.of(getClass());

    @Resource
    private TestService testService;

    @GetMapping("jsp")
    String index() {
        async();
        return "index";
    }

    @GetMapping("async")
    @ResponseBody
    String async() {
        testService.async("ppp");
        return "success";
    }

//    @GetMapping("mono")
//    Mono<String> mono() {
//        return Mono.create(sink -> sink.success("sssssssssssss"));
//    }
}
